package com.woniu.command.handle;

import com.woniu.adapter.EquipmentAdapter;
import com.woniu.outlet.po.Energy;
import com.woniu.outlet.po.Equipment;
import com.woniu.outlet.po.EquipmentStop;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class EquipmentCommandHandle {
    @Autowired
    private EquipmentAdapter equipmentAdapter;


    public Integer addEquipment(Equipment equipment) {
        equipmentAdapter.addEquipment(equipment);
        return 1;
    }

    public Boolean updateEquipment(Equipment equipment) {
        Boolean b = equipmentAdapter.updateEquipment(equipment);
        return b;
    }

    public Boolean deleteEquipmentById(Long id) {
        Boolean b = equipmentAdapter.deleteEquipmentById(id);
        return b;
    }

    public Boolean addEqcuipmentStop(EquipmentStop equipmentStop) {
        Boolean b = equipmentAdapter.addEquipmentStop(equipmentStop);
        return b;
    }

    public Boolean updateEquipmentStop(EquipmentStop equipmentStop) {
        Boolean b = equipmentAdapter.updateEquipmentStop(equipmentStop);
        return b;
    }


    public Integer addEnergy(Energy energy) {
        equipmentAdapter.addEnergy(energy);
        return 1;
    }

    public Boolean updateEnergy(Energy energy) {
        Boolean b = equipmentAdapter.updateEnergy(energy);
        return b;
    }

    public Boolean deleteEnergyById(Long id) {
        Boolean b =equipmentAdapter.deleteEnergyById(id);
        return b;
    }

    public Boolean deleteEquipmentStopById(Long id) {
        Boolean b = equipmentAdapter.deleteEquipmentStopById(id);
        return b;
    }
}
